﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;

namespace dzs.Web
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btn_login_Click(object sender, EventArgs e)
        {
            string name = this.txt_name.Text;
            string pass = this.txt_pass.Text;
            DataSet ds = new dzs.BLL.user().GetList(" user_login='" + name + "' and user_pass='" + pass + "' ");

            if (ds.Tables[0].Rows.Count > 0)
            {
                int user_id = int.Parse(ds.Tables[0].Rows[0]["user_id"].ToString());

                List<int> li = dzs.BLL.Tools.AddSession(new dzs.BLL.rights().GetUserPower(user_id));

                Session["userRights"] = li;//用户权限

                Session["login"] = ds;//用户信息

                //Response.Redirect("Outstorage/ListOutStorage.aspx");
                Response.Redirect("main.aspx");

            }
            else
            {
                Maticsoft.Common.MessageBox.Show(this, "用户名密码错误！");
            }


        }
    }
}
